var e = require;
var t = module;
var o = exports;
var ii, nn = this && this.__extends || (ii = function (t, e) {
    return (ii = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        ii(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }
),
    rr = this && this.__awaiter ||
        function (t, e, o, i) {
            return new (o || (o = Promise))(function (n, a) {
                function r(t) {
                    try {
                        l(i.next(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function s(t) {
                    try {
                        l(i.
                            throw(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(t) {
                    var e;
                    t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
                        t(e)
                    })).then(r, s)
                }
                l((i = i.apply(t, e || [])).next())
            })
        };
var oo = (this && this.__decorate) ||
    function (e, t, a, n) {
        var i,
            o = arguments.length,
            s = o < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, a)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);
        else
            for (var r = e.length - 1; r >= 0; r--)
                (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
        return o > 3 && s && Object.defineProperty(t, a, s), s;
    };
Object.defineProperty(o, "__esModule", { value: !0 });
var a = e("GlobalParams"),
    n = e("EquipInfo"),
    i = cc._decorator,
    r = i.ccclass,
    s =
        (i.property,
            (function () {
                function e() { }
                return (
                    (e.getPlayerInit = function () {
                        return {
                            attack: 0,
                            skill_1: 0,
                            skill_2: 0,
                            skill_3: 0,
                            hp: 0,
                            move_speed: 0,
                            cool_1: 0,
                            cool_2: 0,
                            cool_3: 0,
                            crit: 0,
                            attack_speed: 0,
                            be_hit: 0,
                            be_hit_back: 0,
                            add_attack: 0,
                            attack_hp: 0,
                            suck_blood: 0,
                            skill_add: 0,
                            for_speed: 0,
                            die_up_hp: 0
                        };
                    }),
                    (e.buyEquipInit = function () {
                        for (var e = 0; e < a.GlobalParams.MatchGamePlayer.length; e++)
                            a.GlobalParams.BuyEquipInfo.push(this.getPlayerInit());
                    }),
                    (e.playerBuyEquipInfo = function (e, t) {
                        for (
                            var o = this.getPlayerInit(), i = a.GlobalParams.MatchGamePlayer[e].equip_info, r = 0;
                            r < i.length;
                            r++
                        )
                            if (0 != i[r]) {
                                for (var s = n.default.eqquip_info[i[r]], l = 0; l < s.eq_info.length; l++) {
                                    var _ = "" + s.eq_info[l].type,
                                        c = s.eq_info[l].num;
                                    switch (_) {
                                        case "0":
                                            o.attack += c;
                                            break;
                                        case "1":
                                            o.hp += c;
                                            break;
                                        case "2":
                                            (o.cool_1 += c), (o.cool_2 += c);
                                            break;
                                        case "3":
                                            o.attack_speed += c;
                                            break;
                                        case "4":
                                            o.crit += c;
                                            break;
                                        case "5":
                                            o.move_speed += c;
                                    }
                                }
                                switch ("" + i[r]) {
                                    case "6":
                                        o.be_hit += 5;
                                        break;
                                    case "7":
                                        o.be_hit_back += 5;
                                        break;
                                    case "11":
                                        o.skill_add += 3;
                                        break;
                                    case "12":
                                        o.skill_add += 1;
                                        break;
                                    case "13":
                                        (o.add_attack += 3), (o.attack_hp += 0.5);
                                        break;
                                    case "14":
                                        o.add_attack += 5;
                                        break;
                                    case "16":
                                        o.suck_blood += 3;
                                        break;
                                    case "17":
                                        o.die_up_hp += 100;
                                        break;
                                    case "18":
                                        o.be_hit += 10;
                                        break;
                                    case "19":
                                        (o.be_hit_back += 10), (o.skill_add += 5);
                                        break;
                                    case "20":
                                    case "21":
                                        o.move_speed += 2;
                                        break;
                                    case "22":
                                        o.be_hit += 10;
                                        break;
                                    case "23":
                                        (o.cool_1 += 0.3), (o.cool_2 += 0.3);
                                        break;
                                    case "24":
                                        o.for_speed = 20;
                                        break;
                                    case "25":
                                        (o.cool_1 += 1), (o.cool_2 += 1);
                                        break;
                                    case "26":
                                        o.skill_add += 15;
                                        break;
                                    case "27":
                                        (o.add_attack += 5), (o.attack_hp += 1);
                                        break;
                                    case "28":
                                        o.add_attack += 15;
                                        break;
                                    case "30":
                                        o.suck_blood += 3;
                                        break;
                                    case "31":
                                        o.die_up_hp += 100;
                                        break;
                                    case "32":
                                        o.be_hit += 15;
                                        break;
                                    case "33":
                                        (o.be_hit_back += 20), (o.skill_add += 5);
                                        break;
                                    case "34":
                                        o.move_speed += 2;
                                        break;
                                    case "35":
                                        o.for_speed += 35;
                                        break;
                                    case "36":
                                        (o.cool_1 += 1.5), (o.cool_2 += 1.5);
                                        break;
                                    case "37":
                                        o.skill_add += 25;
                                }
                            }
                        (a.GlobalParams.BuyEquipInfo[e] = o), t();
                    }),
                    oo([r], e)
                );
            })());
o.default = s;
